<div id="goods_exshow_config" class="tableform">
    <div class="division">
        <table width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <th>启用外层div</th>
                <td><input type="checkbox" name="showtag" value="1" <{if $setting.showtag=="1"}> checked="checked"<{/if}> />
                </td>
                <th>楼层方案选择</th>
                <td>
                    <select name="stylename">
                        <option value="floor-plan1" <{if $setting.stylename=="floor-plan1"}>selected<{/if}>>普通平分</option>
                        <option value="floor-plan2" <{if $setting.stylename=="floor-plan2"}>selected<{/if}>>首广告平分</option>
                        <option value="floor-plan3" <{if $setting.stylename=="floor-plan3"}>selected<{/if}>>尾广告平分</option>  
                        <option value="floor-plan7" <{if $setting.stylename=="floor-plan7"}>selected<{/if}>>一行一个</option>
                    </select>
                </td>
            </tr>
            <tr>
              <th>版块标题</th>
              <td><input class="inputstyle" type="text" name="title" value="<{$setting.title}>" style="width:150px" />&nbsp;&nbsp;<i>留空则不显示标题项</i></td>
              <th>版块标题图片</th>
              <td><input name='ad_pic1' class="imgsrc inputstyle" id="ad_pic1" value="<{$setting.ad_pic1}>"><input type=button value="<{t app='b2c'}>上传图片<{/t}>" class="uploadbtn" onclick="addPic('ad_pic1')">&nbsp;&nbsp;<i>不填则显示文字标题</i></td>
            </tr>
            <tr>
                <th>更多文字重定义：</th>
                <td><input type="text" name="moretext" value="<{$setting.moretext|default:更多}>" style="width:200px" class="inputstyle" /></td>
                <th>更多链接地址</th>
                <td><input type="text" name="morelink" value="<{$setting.morelink}>" style="width:200px" class="inputstyle" />不填则不显示</td>
            </tr>
        </table>    
    </div>
    <div class="division">
        <h2 style="text-align:center;color:#ff7600;font-size:18px;">该栏目仅选择首部广告和尾部广告的商品楼层设置</h2>
         <table width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <th>商品广告图片</th>
                <td><input name='ad_pic2' class="imgsrc inputstyle" id="ad_pic2" value="<{$setting.ad_pic2}>"><input type=button value="<{t app='b2c'}>上传图片<{/t}>" class="uploadbtn" onclick="addPic('ad_pic2')"></td>
                <th>商品广告地址</th>
                <td><input type="text" name="banlink" value="<{$setting.banlink}>" style="width:200px" class="inputstyle" /></td>
            </tr>
            <tr>
                <th>商品名称</th>
                <td><input type="text" name="goodsname" value="<{$setting.goodsname}>" style="width:200px" class="inputstyle" />不填不显示</td>
                <th>商品简介</th>
                <td><input type="text" name="goodsdesc" value="<{$setting.goodsdesc}>" style="width:200px" class="inputstyle" />不填不显示</td>
            </tr>
            <tr>
                <th>商品价格</th>
                <td><input type="text" name="goodsprice" value="<{$setting.goodsprice}>" style="width:200px" class="inputstyle" />不填不显示</td>
            </tr>
         </table>
    </div>
    <div class="division">
        <div class="goods-selector-handle clearfix">
            <div class="span-auto">
                <label>
                    <input type="radio"  name="selector" value="filter"  <{if $setting.selector=="filter"}>checked<{/if}> />&nbsp;范围选择商品
                </label>
            </div>
            <div class="span-auto">
                <label><input type="radio"  name="selector" value="select"  <{if $setting.selector=="select"}>checked<{/if}> />&nbsp;精确选择商品</label>
            </div>
        </div>
        <div class="division goods-selector">
            <div data-extend = "filter" <{if $setting.selector=="select"}>style="display:none"<{/if}>>
                <{input type="goodsfilter"  name="goods_filter"  value=$setting.goods_filter}>
                <div class="division">
                    排序规则：
                    <select  name="goods_order_by">
                        <{foreach from=$data.goods_order_by item=item}>
                        <option value="<{$item.condition}>"  <{if $setting.goods_order_by == $item.condition}>selected<{/if}>><{$item.label}></option>
                        <{/foreach}>
                    </select>
                </div>
            </div>
            <div data-extend = "select"  <{if $setting.selector=="filter"}>style="display:none;"<{/if}>>
                <{input type="goods_select"
                object="goods@b2c"
                pdt_name="goods_select"
                pdt_value=$setting.goods_select
                obj_name="goods_select_linkobj"
                obj_value=$setting.goods_select_linkobj
                }>
            </div>
        </div>
    </div>
    <div class="division">
        <table width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <th>最多展示数量：</th>
                <td> <input type="text"  name="limit"  value="<{$setting.limit}>" />个商品</td>
            </tr>
            <tr>
                <th>是否显示简介</th>
                <td><input type="checkbox" name="showdesc" value="1" <{if $setting.showdesc=="1"}> checked="checked"<{/if}> />
                </td>
                <th>简介显示长度：</th>
                <td><input type="text" name="maxlength1" value="<{$setting.maxlength1|default:80}>" class="inputstyle"></td>
            </tr>
        </table>
    </div>
</div>
<script>
    $$('#goods_exshow_config .goods-selector-handle input[type=radio]').addEvent('change',function(){
        var radio  = this;
        if(!radio.checked)return;
        $$('#goods_exshow_config .goods-selector [data-extend]').each(function(item){

            if(item.get('data-extend')!=radio.value){
                item.hide();
                }else{
                item.show();
            }

        });

    });
    function addPic(target){
    var url='index.php?app=desktop&act=alertpages&goto='+encodeURIComponent("index.php?app=image&ctl=admin_manage&act=image_broswer&type=big");
    Ex_Loader('modedialog',function(){
        return new imgDialog(url,{onCallback:function(image_id,image_src){
                $(target).value=image_src;
        }}) ;
    });
}
</script>
